﻿namespace CRMG.Container.Source.OpManager
{
    using CRMG.Container.Resources.ExceptionResources;
    using CRMG.Container.Source.BO;
    using CRMG.Container.Source.DL;
    using CRMG.Container.Source.Variables;
    using Guru.ErrorHandling;
    using System;
    using System.Data;

    public class InterViewManager
    {

        #region [ GetInterViewsOfStudent method ]

        public DataTable GetInterViewsOfStudent(int studentId)
        {
            try
            {
                InterViewDL intVwDL = new InterViewDL();
                return intVwDL.GetInterViewsOfStudent(studentId);
            }
            catch (Exception exc)
            {
                LogEntry logger = new LogEntry(AppVariables.CurrentUser.OBJID)
                {
                    ErrorCode = 2100,
                    Title = Rc.GetString(2100)
                };
                throw new GuruException(exc, logger);
            }
        }

        #endregion


        #region [ AddInterViewAndGetId method ]

        public int AddInterViewAndGetId(InterView pInterView)
        {
            try
            {
                InterViewDL intrvwDL = new InterViewDL();
                return intrvwDL.InsertAndGetId(pInterView);
            }
            catch (Exception exc)
            {
                LogEntry logger = new LogEntry(AppVariables.CurrentUser.OBJID)
                {
                    ErrorCode = 2011,
                    Title = Rc.GetString(2011)
                };
                throw new GuruException(exc, logger);
            }
        }

        #endregion


        #region [ GetInterViews method ]

        public DataTable GetInterViews()
        {
            try
            {
                InterViewDL intrvwDL = new InterViewDL();
                return intrvwDL.GetInterViews();
            }
            catch (Exception exc)
            {
                LogEntry logger = new LogEntry(AppVariables.CurrentUser.OBJID)
                {
                    ErrorCode = 2011,
                    Title = Rc.GetString(2011)
                };
                throw new GuruException(exc, logger);
            }
        }

        #endregion

    }
}
